export default {
  isArray: (arr) => {
    return Array.isArray(arr)
  },
  isBoolean: (arg) => {
    return typeof arg === 'boolean'
  },
  isNull: (arg) => {
    return arg === null
  },
  isNullOrUndefined: (arg) => {
    return arg == null
  },
  isNumber: (arg) => {
    return typeof arg === 'number'
  },
  isString: (arg) => {
    return typeof arg === 'string'
  },
  isSymbol: (arg) => {
    return typeof arg === 'symbol'
  },
  isObject: (arg) => {
    return typeof arg === 'object' && arg !== null
  },
  objectToString: (obj) => {
    return Object.prototype.toString.call(obj)
  },
  isDate: function (d) {
    return this.isObject(d) && this.objectToString(d) === '[object Date]'
  },
  isError: function (e) {
    return this.isObject(e) &&
      (this.objectToString(e) === '[object Error]' || e instanceof Error)
  },
  isFunction: (arg) => {
    return typeof arg === 'function'
  }
}
